function [data] = dataforBCCCE(r1, ensemble, truelabel, k, k_hat)

data.k     = k;
data.k_hat = k_hat;
[N,r]      = size(ensemble);

for i=1:r1    
T           = ensemble(:,i);    
dataw1(i).w = expandT(T,k);
end

for i=r1+1:r    
T              = ensemble(:,i);    
dataw2(i-r1).w = expandT(T,length(unique(T)));
end


data.dataw1    = dataw1;
data.dataw2    = dataw2;
data.truelabel = truelabel;
data.r1        = r1;
data.r2        = r-r1;

end
